package com.coffee.attachment.repository;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.coffee.attachment.entity.ExcelEntity;
import com.coffee.attachment.repository.mapper.MochaExcelMapper;
import org.springframework.stereotype.Service;

/**
 * @author: songkui
 * @since: 2023/4/20 14:20
 */
@Service
public class MochaExcelRepository extends ServiceImpl<MochaExcelMapper, ExcelEntity> {

    public ExcelEntity getByCode(String code){
        LambdaQueryWrapper<ExcelEntity> lambdaQueryWrapper = Wrappers.lambdaQuery();
        lambdaQueryWrapper.eq(ExcelEntity::getExcelCode, code);
        return getOne(lambdaQueryWrapper);
    }
}
